function luminance=lumin( img )
% returns 2D array of floating point values in range 0-1, representing
% luminnace of image img

luminance = double( sum( img, 3 ) ) / (3*256);